package com.aaa.demo11;

/**
 * @author ${崔灿}
 * @date 2022/11/03 19:24
 **/

public class Test {
    public static void main(String[] args) {
        Swimming s = new Swimming(){
            @Override
            public void swimming() {
                System.out.println("匿名内部类");
            }
        };
        fun(s);
    }
    public static void fun(Swimming s) {
        s.swimming();
    }
}

//这个就是函数式接口
@FunctionalInterface
interface  Swimming{
    public void swimming();
}